package com.itheima.dubbo.mysql.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.commons.pojo.domain.UserInfo;
import com.itheima.commons.pojo.entity.Distribution;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;

/**
 * @author yaohu
 * @date 2021/12/5
 * @Version 1.0
 * @describe
 */
@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    //注册用户分布，行业top、年龄、性别、地区
    List<Distribution> findIndustryTopTen(@Param("startTime") Date startTime,@Param("endTime") Date endTime);
    List<Distribution> findAgeDistribution(@Param("startTime") Date startTime,@Param("endTime") Date endTime);
    List<Distribution> findgenderDistribution(@Param("startTime") Date startTime,@Param("endTime") Date endTime);
    List<Distribution> findlocalTotal(@Param("startTime") Date startTime,@Param("endTime") Date endTime);
    List<Distribution> findlocalDistribution(@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    //新增、活跃用户、次日留存率 单日查询
    Distribution findNewUser(@Param("date") String date);

    //累积用户
    Long findCumulativeUsers();

    //今日新增用户
    Long findNewUsersToday(@Param("date") String date);
}
